|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPER.rover.API
API class
Constructor Summary | |
API()
Class constructor. |
Method Summary | |
boolean |
Blacklight(boolean enabled)
Turns on or off the blacklight. |
boolean |
ColorTrack(java.awt.Color myColor,
float deviation)
Track the given color by moving the head pan/tilt and using method "0". |
boolean |
ColorTrack(java.awt.Color myColor,
float deviation,
int method,
boolean movePan,
boolean moveTilt)
Track the given color by moving the head pan/tilt and using method "0". |
boolean |
ColorTrack(int minY,
int maxY,
int minU,
int maxU,
int minV,
int maxV)
Track the given color (int YUV space) by moving the head pan/tilt and using method "0". |
boolean |
ColorTrack(int minY,
int maxY,
int minU,
int maxU,
int minV,
int maxV,
int method,
boolean movePan,
boolean moveTilt)
Track the given color (int YUV space) by moving the head pan/tilt and using method "0". |
boolean |
Drive(int cm,
int angle)
Moves forward cm centimeters unless obstructed by an obstacle. |
java.awt.image.BufferedImage |
GetPanorama(TakePanoramaAction myAction,
boolean waitForIt)
Gets the BufferedImage taken by the action myAction. |
void |
initialize(Rover rov)
Sets this instance of API to use the Rover rov. |
boolean |
Kill()
Abort whatever the rover is currently doing. |
boolean |
LookAt(int pan,
int tilt)
Sets the rover's head to the given pan and tilt. |
static void |
main(java.lang.String[] args)
test main function which turns on the blacklight |
boolean |
PanoramaFinished(TakePanoramaAction myAction)
Returns true if myAction has finished executing. |
void |
Println(java.lang.String output)
Just like regular println, prints a string to the console. |
TakePanoramaAction |
StartPanorama(int lowAng,
int highAng,
int width,
int height)
Causes the rover to take a panoramic image, resetting the head position to 0,0 |
java.awt.image.BufferedImage |
TakePicture(int pan,
int tilt,
int width,
int height,
boolean UV)
Causes the rover to take a single image. |
boolean |
TurnTo(int deg)
Rotates the rover by deg degrees about its center, in a counterclockwise direction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public API()
Method Detail |
public void initialize(Rover rov)
rov
- A Rover object with which the API can talk to the PER.public java.awt.image.BufferedImage TakePicture(int pan, int tilt, int width, int height, boolean UV)
pan
- The pan value in degrees at which to take the picturetilt
- The tilt vale in degrees at which to take the picturewidth
- The width of the image in pixelsheight
- The hiehgt of the image in pixelsUV
- True if the UV light should be on for the picture, false otherwise
Upon failure returns null
BufferedImage
public TakePanoramaAction StartPanorama(int lowAng, int highAng, int width, int height)
lowAng
- The minimum tilt angle that the picture includeshighAng
- The maximum tilt angle that the picture includeswidth
- The width in pixels of the target imageheight
- The height in pixels of the target image
public boolean PanoramaFinished(TakePanoramaAction myAction)
myAction
- A TakePanoramaAction created via a call to StartPanorama
public java.awt.image.BufferedImage GetPanorama(TakePanoramaAction myAction, boolean waitForIt)
myAction
- A TakePanoramaAction created via a call to StartPanoramawaitForIt
- if true, the thread will block until the action is done, or we've waited 30 seconds
Returns null if myAction failed, if myAction is not completed and waitForIt is false, or if myAction has timed out while waiting for it to complete.
BufferedImage
public boolean LookAt(int pan, int tilt)
pan
- The pan value in degrees at which to take the picturetilt
- The tilt vale in degrees at which to take the picture
public boolean TurnTo(int deg)
deg
- Distance to turn in degrees
public boolean Drive(int cm, int angle)
cm
- Distance to travel in centimetersangle
- Angle in degrees counterclockwise from current heading to turn before driving
public boolean Blacklight(boolean enabled)
enabled
- Set to true to turn on the blacklight, false to turn it off
public void Println(java.lang.String output)
output
- The string to printpublic boolean Kill()
public boolean ColorTrack(java.awt.Color myColor, float deviation)
myColor
- The color to trackdeviation
- the percentage deviation from the given color's values to track
note: should there be a seperate deviation for each color?
public boolean ColorTrack(java.awt.Color myColor, float deviation, int method, boolean movePan, boolean moveTilt)
myColor
- The color to trackdeviation
- the percentage deviation from the given color's values to trackmethod
- method used for color tracking, enumerate latermovePan
- Track color by allowing head Pan movementmoveTilt
- Track color by allowing head Tilt movement
note: should there be a seperate deviation for each color?
public boolean ColorTrack(int minY, int maxY, int minU, int maxU, int minV, int maxV)
minY
- The minimum Y value of the color to trackmaxY
- The maximum Y value of the color to trackminU
- The minimum U value of the color to trackmaxU
- The maximum U value of the color to trackminV
- The minimum V value of the color to trackmaxV
- The maximum V value of the color to track
public boolean ColorTrack(int minY, int maxY, int minU, int maxU, int minV, int maxV, int method, boolean movePan, boolean moveTilt)
minY
- The minimum Y value of the color to trackmaxY
- The maximum Y value of the color to trackminU
- The minimum U value of the color to trackmaxU
- The maximum U value of the color to trackminV
- The minimum V value of the color to trackmaxV
- The maximum V value of the color to trackmethod
- method used for color tracking, enumerate latermovePan
- Track color by allowing head Pan movementmoveTilt
- Track color by allowing head Tilt movement
public static void main(java.lang.String[] args)
args
- Not used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |